<template>
  <div class="home">
    <h1>你好 这里是主页</h1>
  </div>
</template>

<script setup lang="ts" name="Home">
import { onMounted } from "vue";
import { useRouter } from "vue-router";

const router = useRouter();
// 实现编程式路由导航
onMounted(() => {
  setTimeout(() => {
    //在此处编写代码  实现路由跳转
    router.push("/news");
  }, 3000);
});
</script>

<style scoped>
.home {
  display: flex;
  justify-self: center;
  align-items: center;
  height: 100%;
}
</style>
